package file

import (
	partner "gitee.com/binny_w/gin-partner"
	"gitee.com/binny_w/gin_starter/core"
	"net/http"
)

var MdlFile *partner.CommonModel

func init() {
	core.WaitCore.Wait()

	MdlFile = partner.NewCommonModel()

	_ = MdlFile.RegisterGinHandler(http.MethodPost, "/file/upload", upload)
	_ = MdlFile.RegisterGinHandler(http.MethodPost, "/file/upload-img", UploadImage)
	_ = MdlFile.RegisterGinHandler(http.MethodGet, "/file/get", get)

	_ = MdlFile.RegisterGinHandler(http.MethodPost, "/file/del", del)

	core.Engine.RouterWithModel(core.ApiGroup, MdlFile)
}
